package kr.hkit.otherjavawork;

public class Two {

    private int num, reversenum;
    
    public Two(int num) {
        super();
        this.num = num;
    }

    int reverse(){
        reversenum=0;
        do{
        reversenum = reversenum + num%10;
        num = num / 10;
        if(num > 0)
            reversenum = reversenum * 10;
        } while(num > 0);
        
        return reversenum;
    }

    @Override
    public String toString() {
        return "Two [기존의 수는 " + num + ", 뒤집힌 수는" + reverse() + "]";
    }
    
    
}
